<template>
	<view class="feedback">
		<p>*问题类型</p>
		<view>
			<p :class="{'p':index==0}" @click='select(0)'>功能建议<span></span></p>
			<p :class="{'p':index==1}" @click='select(1)'>功能异常<span></span></p>
			<p :class="{'p':index==2}" @click='select(2)'>体验问题<span></span></p>
			<p :class="{'p':index==3}" @click='select(3)'>其他<span></span></p>
			<p :class="{'p':index==4}" @click='select(4)' style="border-bottom: 0;">投诉<span></span></p>
		</view>
		<p>*反馈内容</p>
		<view>
			<textarea style="min-height: 180rpx;" placeholder="请描述您的问题或建议~" auto-height />
		</view>
		<p>*上传凭证</p>
		<view>
			<view class="upload">
				<view v-for='(value,index) in img' :key="index">
					<img :src="value.src">
				</view>
				<view class="view" @click="Image">
					<image src="../../../../static/technician/71.png"></image>上传图片
				</view>
			</view>
		</view>
		<p>*联系方式</p>
		<view>
			<p style="border-bottom: 0;"><input type="text" placeholder="请输入手机号"></p>
		</view>
		<button>修改手机号</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				img: [],
				index: 0
			};
		},
		methods: {
			select(index) {
				this.index = index
			},
			Image() {
				let that = this
				uni.chooseImage({
					count: 1, //默认9
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album'], //从相册选择
					success: function(res) {
						console.log(res.tempFilePaths[0]);
						that.img.push({
							name: 'img',
							src: res.tempFilePaths[0]
						})
					}
				});
			},
		}
	}
</script>

<style lang="less">
	.feedback {
		display: flex;
		flex-direction: column;
		color: #333;

		&>button {
			width: 690rpx;
			height: 80rpx;
			line-height: 80rpx;
			color: #fff;
			background: #5FC07B;
			font-size: 15px;
			margin-top: 100rpx;
		}

		&>p {
			font-size: 13px;
			margin: 24rpx 44rpx;
			font-weight: bold;
		}

		&>view {
			width: 690rpx;
			background: #fff;
			border-radius: 20rpx;
			padding: 0 20rpx;
			box-sizing: border-box;
			margin: 0 auto;

			&>.upload {
				display: flex;
				flex-wrap: wrap;

				&>view {
					width: 185rpx;
					height: 185rpx;
					border-radius: 5px;
					overflow: hidden;
					margin: 10rpx;

					&>img {
						width: 100%;
						height: 100%;
					}

					&>video {
						width: 100%;
						height: 100%;
					}
				}

				&>.view {
					width: 194rpx;
					height: 194rpx;
					border-radius: 5px;
					border: 1px dashed #BCBCBC;
					display: flex;
					align-items: center;
					justify-content: center;
					flex-direction: column;
					font-size: 12px;
					color: #9E9E9E;
					margin: 20rpx;

					&>image {
						width: 40rpx;
						height: 36rpx;
						margin-bottom: 10rpx;
					}
				}
			}

			&>textarea {
				font-size: 10px;
				padding: 20rpx 0;
				box-sizing: border-box;
			}

			&>.p {
				color: #333;

				&>span {
					background: #50B674;
				}
			}

			&>p {
				width: 100%;
				height: 66rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				font-size: 12px;
				color: #9E9E9E;
				border-bottom: 1px solid #E1E1E1;

				&>input {
					font-size: 10px;
				}

				&>span {
					width: 20rpx;
					height: 20rpx;
					background: #F0F0F0;
					border-radius: 50%;
					margin-right: 30rpx;
				}
			}
		}
	}
</style>